<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>用户角色配置</title>
		<#include "../include/base.ftl">
	</head>
	<body>
		
		<table id="user-list-box" class="easyui-datagrid" style="width:60%;height:650px;" toolbar="#user-list-btn"
				title="用户角色配置" iconCls="icon-save" url="user/list_data" singleSelect=true
				rownumbers="true" pagination="true" pageSize=10  pageList=[10,20,30,40,50]  pageNumber=1>
			<thead>
				<tr>
					<th field="id" width="80">ID</th>
					<th field="username" width="150">用户名</th>
					<th field="name" width="150" align="center">姓名</th>
					<th field="createdTime" width="200" align="center">创建时间</th>
					<th field="status" width="100" align="center" formatter="formatStatus">当前状态</th>
				</tr>
			</thead>
		</table>
		
		<div id="user-list-btn">
			<span>用户名:</span>
			<input id="username" style="border:1px solid #ccc">
			<span>姓名:</span>
			<input id="name" style="border:1px solid #ccc">
			<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" onclick="doSearch()">查询</a>
		</div>
		
		
		<script type="text/javascript">
			/**
			 * 格式化用户状态显示
			 */ 
			function formatStatus(value,rowdata,index) {
		   		if(value=='1') {
		   			return "正常";
		   		}else{
		   			return "凍結";
		   		}
		   	}
			
			
			/**
			 *	提交用户添加表单
			 */
			function submitSaveUser(){
				$('#edit-user-form').form('submit',{
					onSubmit:function(){
						return $(this).form('validate');
					},
					success:function(data){
						var data = eval('(' + data + ')');  
						$.messager.alert('Info', data.message, 'info');
						$('#edit-user-box').dialog('close');
						$('#user-list-box').datagrid('reload');
					}
				});
			}
			
			/**
			 *	提交查询
			 */
			function doSearch(){
				$('#user-list-box').datagrid('load',{
					username: $('#username').val(),
					name: $('#name').val()
				});
			}
			
		</script>
	</body>
</html>